<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Create account form template
 *
 * @see Mage_Customer_Block_Form_Register
 */
?>
<div class="page-head">
    <h3><?php echo $this->__('Create an Account') ?></h3>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
    <fieldset class="group-select wide">
    <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>"/>
    <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>"/>
        <div class="head-alt2">
            <h4 class="title"><?php echo $this->__('Personal Information') ?></h4>
        </div>
        <ul>
            <li>
                <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
            </li>
            <li>
                <div class="input-box">
                    <label for="email_address"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br/>
                    <input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text"/>
                </div>
            </li>
            <?php if ($this->isNewsletterEnabled()): ?>
            <li>
                <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed" <?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif ?>/>
                <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
            </li>
            <?php endif ?>
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php if ($_dob->isEnabled()): ?>
            <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
<?php endif ?>
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
<?php if ($_taxvat->isEnabled()): ?>
            <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
<?php endif ?>
        </ul>
    </fieldset>
<?php if($this->getShowAddressFields()): ?><br/>
    <input type="hidden" name="create_address" value="1"/>
    <fieldset class="group-select wide">
        <div class="head-alt2">
            <h4 class="title"><?php echo $this->__('Address Information') ?></h4>
        </div>
        <ul>
            <li>
                <div class="input-box">
                    <label for="company"><?php echo $this->__('Company') ?></label><br/>
                    <input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text"/>
                </div>
                <div class="input-box">
                    <label for="lastname"><?php echo $this->__('Telephone') ?> <span class="required">*</span></label><br/>
                    <input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="required-entry input-text"/>
                </div>
            </li>
            <li>
                <label for="street_1"><?php echo $this->__('Street Address') ?> <span class="required">*</span></label><br/>
                <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(1)) ?> " title="<?php echo $this->__('Street Address') ?>" id="street_1" class="required-entry input-text"/>
            </li>
<?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
            <li>
                <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i)) ?> " title="<?php echo $this->__('Street Address '.$_i) ?>" id="street_<?php echo $_i?>" class="input-text"/>
            </li>
<?php endfor ?>
            <li>
                <div class="input-box">
                    <label for="city"><?php echo $this->__('City') ?> <span class="required">*</span></label><br/>
                    <input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>"  title="<?php echo $this->__('City') ?>" class="required-entry input-text" id="city"/>
                </div>
                <div class="input-box">
                    <label for="region_id"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br/>
                    <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none">
                        <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
                    </select>
                    <script type="text/javascript">
                        $('region_id').setAttribute('defaultValue',  "<?php echo $this->getFormData()->getRegionId() ?>");
                    </script>
                    <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>"  title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none"/>
                </div>
            </li>
            <li>
                <div class="input-box">
                    <label for="zip"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br/>
                    <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="validate-zip-international required-entry input-text"/>
                </div>
                <div class="input-box">
                    <label for="country"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br/>
                    <?php echo $this->getCountryHtmlSelect() ?>
                </div>
            </li>
        </ul>
    </fieldset>
    <input type="hidden" name="default_billing" value="1"/>
    <input type="hidden" name="default_shipping" value="1"/>
<?php endif; ?>
    <fieldset class="group-select wide">
        <br />
        <div class="head-alt2">
            <h4 class="title"><?php echo $this->__('Login Information') ?></h4>
        </div>
        <ul>
            <li>
                <div class="input-box">
                    <label for="password"><?php echo $this->__('Password') ?> <span class="required">*</span></label><br/>
                    <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>"  class="required-entry validate-password input-text"/>
                </div>
                <div class="input-box">
                    <label for="confirmation"><?php echo $this->__('Confirm Password') ?> <span class="required">*</span></label><br/>
                    <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="required-entry validate-cpassword input-text"/>
                </div>
            </li>
        </ul>
    </fieldset>
    <div class="button-set">
        <p class="required"><?php echo $this->__('* Required Fields') ?></p>
        <a href="<?php echo $this->getBackUrl() ?>" class="f-left">&laquo; <?php echo $this->__('Back') ?></a>
        <input type="image" src="<?php echo $this->getSkinUrl('images/btn_submit.gif') ?>" alt="<?php echo $this->__('Submit') ?>"/>
    </div>
</form>
<script type="text/javascript">
    var dataForm = new VarienForm('form-validate', true);
    <?php if($this->getShowAddressFields()): ?>
    new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>);
    <?php endif ?>
</script>